﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CarPrice
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            double sum;
            double discount;
            double total;
            sum = 30900;
            discount = 0;
            if (checkBox1.Checked) 
            {
                //ABS
                sum += 8390;
            }
            if (checkBox2.Checked) 
            {
                //ESP
                sum += 5990;
            }
            if (checkBox3.Checked) 
            {
                //parktronic
                sum += 7590;
            }
            total = sum;
            string st;
            st = "Package price: " + sum.ToString("C");
            if ((checkBox1.Checked) && (checkBox2.Checked) && (checkBox3.Checked)) 
            {
                discount = sum * 0.1;
                total = total - discount;
                st += "\nDiscount (1%): " + discount.ToString("C") + "\nTotal: " + total.ToString("C");
            }
            label3.Text = st;
        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            label3.Text = "";
        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {

        }
    }
}
